<template>
  <basic-container>
    <avue-tabs :option="tabsOption" @change="handleChange"></avue-tabs>
    <template v-if="tabsType.prop==='0'">
      <terminal />
    </template>
    <template v-else-if="tabsType.prop==='1'">
      <equipment />
    </template>
    <!-- 检测是否选择商户 -->
    <selectMer :dialogVisible="tipsShow" />
  </basic-container>
</template>

<script>
import terminal from "./component/terminal";
import equipment from "./component/equipment";
import {mapGetters} from "vuex";

export default {
  components: {
    terminal,
    equipment
  },
  computed: {
    ...mapGetters(["selectMer"])
  },
  data() {
    return {
      tipsShow:false,
      tabsType: {},
      tabsOption: {
        column: [
          {
            label: "终端管理",
            prop: "0"
          },
          {
            label: "设备管理",
            prop: "1"
          },
        ],
      },
    };
  },
  created() {
    this.tabsType = this.tabsOption.column[0];
    /* 检测是否选择了商户，没有选择跳转页面进行选择 */
    this.actTips();
  },
  methods: {
    /* 检测是否选择了商户，没有选择跳转页面进行选择 */
    actTips(){
      if(!this.selectMer.rpiNo){
        this.tipsShow=true;
      }
    },
    handleChange(column) {
      this.tabsType = column;
    }
  },
};
</script>

<style>
</style>
